#!/bin/sh -e
# iptables
#[ -x /sbin/iptables ] || exit 0

# ip6tables
[ -x /sbin/ip6tables ] || exit 0
ip6tables -F INPUT
ip6tables -P INPUT ACCEPT
ip6tables -A INPUT -p icmpv6 -m mac --mac-source 00:21:5c:50:d7:c3 -j ACCEPT
ip6tables -A INPUT -p icmpv6 -m mac --mac-source 00:1d:72:96:50:14 -j ACCEPT
ip6tables -A INPUT -p icmpv6 -m mac ! --mac-source 00:1a:e3:ce:82:51 -j DROP

# arptables
[ -x /sbin/arptables ] || exit 0
arptables -F INPUT
arptables -P INPUT DROP
arptables -A INPUT -s 59.64.156.1/22 -j ACCEPT
arptables -A INPUT -s 118.229.0.0/16 -j ACCEPT
arptables -A INPUT --source-mac 00:0c:6e:81:2e:0b -j DROP

exit 0
